/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JSplashScreen.java
 *
 * Created on 13-dic-2009, 13:47:00
 */

package es.atareao.alejandria.gui;

/**
 *
 * @author atareao
 */
public class JSplashScreen extends javax.swing.JFrame implements Runnable{

    /** Creates new form JSplashScreen */
    public JSplashScreen() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jImage1 = new es.atareao.alejandria.gui.JImage();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setUndecorated(true);

        jImage1.setResourceUrl("/es/atareao/alejandria/gui/password.png");

        javax.swing.GroupLayout jImage1Layout = new javax.swing.GroupLayout(jImage1);
        jImage1.setLayout(jImage1Layout);
        jImage1Layout.setHorizontalGroup(
            jImage1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 32777, 32777)
        );
        jImage1Layout.setVerticalGroup(
            jImage1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 32777, 32777)
        );

        getContentPane().add(jImage1, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new Thread(new JSplashScreen()).run();
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private es.atareao.alejandria.gui.JImage jImage1;
    // End of variables declaration//GEN-END:variables

    @Override
    public void run() {
        try {
            this.setLocationRelativeTo(null);
            this.setVisible(true);
            Thread.sleep(5000);
            this.dispose();
        } catch (InterruptedException ex) {
            ErrorDialog.manejaError(ex);
        }
    }

}
